{namespace i=TYPO3\CMS\Install\ViewHelpers}

<div class="panel panel-default">
	<div class="panel-heading" role="tab" id="heading{sectionName}">
		<h3 class="panel-title">
			<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{sectionName}" aria-expanded="true" aria-controls="collapse{sectionName}" class="collapsed">
				<span class="caret"></span>
				<strong><i:object.arrayValueByKey array="{sections}" key="{sectionName}" /></strong> [{sectionName}]
			</a>
		</h3>
	</div>
	<div id="collapse{sectionName}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading{sectionName}">
		<f:for each="{sectionData}" as="item">
			<a id="{sectionName}-{item.key}"></a>
			<div class="item">
				<div class="item-heading">
					<strong>[{sectionName}][{item.key}] </strong>
					<f:if condition="{item.type} == 'checkbox'">
						<f:then>
							= {item.value}
						</f:then>
						<f:else>
							<f:if condition="{item.value}">
								= {item.value -> i:format.crop(maxCharacters: 40)}
							</f:if>
						</f:else>
					</f:if>
				</div>
				<div class="item-body">
					<f:if condition="{item.type} == 'checkbox'">
							<div class="checkbox">
								<label>
									<input
											type="hidden"
											value="0"
											name="install[values][{sectionName}][{item.key}]"
									/>
									<input
											type="checkbox"
											value="1"
											name="install[values][{sectionName}][{item.key}]"
											{f:if(condition: item.checked, then:'checked="checked"')}
									/>
									{item.description -> f:format.raw()}
								</label>
							</div>
						</f:if>

					<f:if condition="{item.type} == 'input'">
						<div class="form-group">
						<span class="help-block">{item.description -> f:format.raw()}</span>
							<input
									type="text"
									value="{item.value}"
									name="install[values][{sectionName}][{item.key}]"
									class="t3-install-form-input-text form-control"
							/>
						</div>
					</f:if>

					<f:if condition="{item.type} == 'textarea'">
						<span class="help-block">{item.description -> f:format.raw()}</span>
						<div class="form-group">
							<textarea
									rows="5"
									cols="60"
									name="install[values][{sectionName}][{item.key}]"
									class="form-control"
							>{item.value}</textarea>
						</div>
					</f:if>

					<f:if condition="{item.phpErrorCode}">
						<div class="fieldNote">
							Current PHP error code <strong>{item.value}</strong> represents:<br/>
							<code><i:format.phpErrorCode phpErrorCode="{item.value}" /></code>
						</div>
					</f:if>
				</div>
			</div>
		</f:for>
	</div>
</div>
